This replication archive contains three main folders, the contents of which are described below:

1. data
2. code
3. results

All contents of this replication archive should be maintained within their current directory structure in order to allow for the R scripts to properly access necessary files. 

The R version employed in the creation of this replication archive was R version 4.4.1 (2024-06-14, "Race for Your Life"). The R packages used are 'dplyr' (1.1.4), 'ggplot2' (3.5.1), 'lmtest' (0.9.40), 'sandwich' (3.1.0), 'tidyr' (1.3.1), and 'xtable' (1.8.4). Runtimes for the R scripts can be found at the end of this document.


(1) The 'data' folder contains 2 subfolders and a variable codebook.

The 'candidate' subfolder contains data corresponding to the study's Candidate scenario, and the 'immigrant' subfolder contains data corresponding to the study's Immigrant scenario. Each subfolder contains two csv files, both of which are structured at the respondent-trial level (i.e. each row corresponds to one conjoint trial/table evaluated by a respondent). The csv with the filename ending in 'conj' contains the data on the randomized conjoint tables (for both profiles in each table) and the respondent's preferred profile choice, along with additional study design and indexing variables. The csv with the filename ending in 'fix' contains the eye-tracking variables, along with additional study design and indexing variables.

See the variable codebook for more information.


(2) The 'code' folder contains 81 R scripts and an additional subfolder ('helper_functions') containing functions that are sourced by those R scripts.

The script '0_main.R' sources all of the other 80 R scripts in the appropriate sequence in order to produce all figures and tables. All results (described below) can be reproduced by simply running the script '0_main.R'.


(3) The 'results' folder contains 3 subfolders.

The 'figures' subfolder contains the figures included in the main study text and appendix. The 'tables' subfolder contains the results presented in the tables in the main study text and appendix. The 'objects' subfolder contains intermediary Rdata objects that are created and used by certain R scripts.


(*) Approximate runtimes for the R scripts on a standard laptop (11th Gen Intel Core i7-11800H @ 2.30 GHz, 32.00 GB RAM, Windows 11 64-bit) can be found below.

code/1a_create_Figure1a.R: < 3 seconds
code/1b_create_Figure1b.R: < 3 seconds
code/1c_create_Figure1c.R: < 3 seconds
code/1d_create_Figure1d.R: < 3 seconds
code/1e_create_Table2_CandidateScenario.R: < 10 seconds
code/1f_create_Table2_ImmigrantScenario.R: < 10 seconds
code/2a_create_Figure2a.R: < 10 seconds
code/2b_create_Figure2b.R: < 10 seconds
code/3a_create_Figure3a.R: < 3 seconds
code/3b_create_Figure3b.R: < 3 seconds
code/4_create_Figure4.R: < 3 seconds
code/5_create_Figure5.R: < 3 seconds
code/6_create_Figure6.R: < 3 seconds
code/7_create_Figure7.R: < 3 seconds
code/8_create_TableA6.R: < 10 seconds
code/9_create_TableA7.R: < 10 seconds
code/10_create_TableA8.R: < 10 seconds
code/11a_create_FigureA2a.R: < 3 seconds
code/11b_create_FigureA2b.R: < 3 seconds
code/12a_create_FigureA3a.R: < 3 seconds
code/12b_create_FigureA3b.R: < 3 seconds
code/12c_create_FigureA3c.R: < 3 seconds
code/13a_create_FigureA4a.R: < 3 seconds
code/13b_create_FigureA4b.R: < 3 seconds
code/14a_create_FigureA5a.R: < 3 seconds
code/14b_create_FigureA5b.R: < 3 seconds
code/14c_create_FigureA5c.R: < 3 seconds
code/14d_create_FigureA5d.R: < 3 seconds
code/15a_create_FigureA6a.R: < 3 seconds
code/15b_create_FigureA6b.R: < 3 seconds
code/15c_create_FigureA6c.R: < 3 seconds
code/15d_create_FigureA6d.R: < 3 seconds
code/16a_create_FigureA7a.R: < 3 seconds
code/16b_create_FigureA7b.R: < 3 seconds
code/17a_create_FigureA8a.R: < 3 seconds
code/17b_create_FigureA8b.R: < 3 seconds
code/17c_create_FigureA8c.R: < 3 seconds
code/17d_create_FigureA8d.R: < 3 seconds
code/18a_create_FigureA9a.R: < 3 seconds
code/18b_create_FigureA9b.R: < 3 seconds
code/18c_create_FigureA9c.R: < 3 seconds
code/18d_create_FigureA9d.R: < 3 seconds
code/19a_create_FigureA10a.R: < 3 seconds
code/19b_create_FigureA10b.R: < 3 seconds
code/20a_create_FigureA11a.R: < 3 seconds
code/20b_create_FigureA11b.R: < 3 seconds
code/21a_create_FigureA12a.R: < 3 seconds
code/21b_create_FigureA12b.R: < 3 seconds
code/21c_create_FigureA12c.R: < 3 seconds
code/21d_create_FigureA12d.R: < 3 seconds
code/22a_create_FigureA13a.R: < 3 seconds
code/22b_create_FigureA13b.R: < 3 seconds
code/23a_create_FigureA14a.R: < 3 seconds
code/23b_create_FigureA14b.R: < 3 seconds
code/24a_create_FigureA15a.R: < 3 seconds
code/24b_create_FigureA15b.R: < 3 seconds
code/25a_create_FigureA16a.R: < 3 seconds
code/25b_create_FigureA16b.R: < 3 seconds
code/26a_create_FigureA17a.R: < 10 seconds
code/26b_create_FigureA17b.R: < 10 seconds
code/27a_create_FigureA18a.R: < 3 seconds
code/27b_create_FigureA18b.R: < 3 seconds
code/28a_create_FigureA19a.R: < 10 seconds
code/28b_create_FigureA19b.R: < 10 seconds
code/29a_create_FigureA20a.R: ~ 20 seconds
code/29b_create_FigureA20b.R: ~ 20 seconds
code/30_create_FigureA21.R: < 3 seconds
code/31_create_FigureA22.R: < 3 seconds
code/32_create_FigureA23.R: < 3 seconds
code/33_create_FigureA24.R: < 3 seconds
code/34_create_FigureA25.R: < 3 seconds
code/35_create_FigureA26.R: < 3 seconds
code/36a_create_FigureA27a.R: ~ 25 minutes
code/36b_create_FigureA27b.R: ~ 25 minutes
code/37_create_FigureA28.R: < 3 seconds
code/38_create_FigureA29.R: < 3 seconds
code/39_create_FiguresA30-A36.R: < 3 seconds
code/40_create_FiguresA37-A42.R: < 3 seconds
code/41_create_FigureA43.R: < 3 seconds
code/42_create_FigureA44.R: < 3 seconds
